import React from 'react'
import { Input,Table,Space} from 'antd';
import '@/assets/scss/hj/Setparams.scss'
import {getListAPI} from '../../http/hj/api'
import { useEffect, useState } from 'react'

const { Search } = Input;
const columns = [
    {
        title:'参数ID',
        dataIndex:'id',
        align:'center',
        width:'10%',
        key:'id'
    },{
        title:'类型',
        dataIndex:'type',
        align:'center',
        key:'type'
    },{
        title:'名称',
        dataIndex:'name',
        align:'center',
        key:'name'
    },{
        title:'值',
        dataIndex:'number',
        align:'center',
        key:'number'
    },{
        title:'说明',
        dataIndex:'explain',
        align:'center',
        key:'explain'
    },{
        title:'更新时间',
        dataIndex:'updateTime',
        align:'center',
        key:'updateTime'
    },{
        title:'操作',
        key:'action',
        align:'center',
        render:(text, record) => (
            <Space size='middle'>
               <a>修改</a>
            </Space>
         )
    }
]
export default function Hj() {
     //const data = [
    //     {
    //         id:201709091123,
    //         type:'交易参数',
    //         name:'充值手续费',
    //         number:0,
    //         explain:'设置值为x,则收取对应充值手续费“x%',
    //         updateTime:'2017-01-01 12:23:33'
    //     },{
    //         id:201709091123,
    //         type:'交易参数',
    //         name:'充值手续费承担方',
    //         number:0,
    //         explain:'0为平台; 1为用户',
    //         updateTime:'2017-01-01 12:23:33'
    //     },{
    //         id:201709091123,
    //         type:'交易参数',
    //         name:'充值手续费',
    //         number:0,
    //         explain:'充值最小金额',
    //         updateTime:'2017-01-01 12:23:33'
    //     },{
    //         id:201709091123,
    //         type:'交易参数',
    //         name:'充值手续费',
    //         number:0,
    //         explain:'充值最小金额',
    //         updateTime:'2017-01-01 12:23:33'
    //     },{
    //         id:201709091123,
    //         type:'交易参数',
    //         name:'提现手续承担方',
    //         number:0,
    //         explain:'充值最小金额',
    //         updateTime:'2017-01-01 12:23:33'
    //     }
    // ]
    const onSearch = () => {//搜索

    }
    const [data,setData] = useState(0)
    useEffect(() => {
        getListAPI()
        .then(res => {
          console.log(res.data);
          setData(res.data)
        })
        .catch ( err => {
          console.log(err);
        })
      },[])
    return (
        <div>
          <div className="Header">
             <Search placeholder="参数名称" onSearch={onSearch}/>
          </div>
          <div className="tab"> 
            <Table columns={columns} dataSource={data}></Table>
          </div> 
        </div>
    )
}
